/*
 * device_info.h
 *
 *  Created on: 12.06.2013
 *      Author: SpirTanol
 */

#ifndef DEVICE_INFO_H_
#define DEVICE_INFO_H_

enum DeviceType
{
	DT_DPE11,
	DT_UNKOWN,
};

class DeviceInfo
{
	DeviceType oType;
	int oAddr;
	int oSpeed;
	int oFormat;
	int oPort;
	int oVersion;

	int oCurScale;
	float oCurMin;
	float oCurMax;

public:
	DeviceInfo() {}
	~DeviceInfo() {}

	inline void setPort(int port) { oPort = port; }
	inline int port() const { return oPort; }

	inline void setType(DeviceType type) { oType = type; }
	inline DeviceType type() const { return oType; }

	inline void setAddr(int addr) { oAddr = addr; }
	inline int addr() const { return oAddr; }

	inline void setSpeed(int speed) { oSpeed = speed; }
	inline int speed() const { return oSpeed; }

	inline void setFormat(int format) { oFormat = format; }
	inline int format() const { return oFormat; }

	inline void setVersion(int ver) { oVersion = ver; }
	inline int version() const { return oVersion; }

	inline void setCurrentInfo(int scale, float min, float max) { oCurScale = scale; oCurMin = min; oCurMax = max; }
	inline int curScale() const { return oCurScale; }
	inline float curMin() const { return oCurMin; }
	inline float curMax() const { return oCurMax; }

	inline DeviceInfo *clone() const { return new DeviceInfo(*this); }

private:
	DeviceInfo(DeviceInfo *ptr) {}

	template<class T>
	friend T *newIn(void*);

};

#endif /* DEVICE_INFO_H_ */
